<template>
    <div>
        <h1>新增地址</h1>
        姓名：<input type="text" v-model="name" /> <br>
        区域：<input type="text" v-model="area" /> <br>
        地址：<input type="text" v-model="address" /> <br>
        电话号码：<input type="text" v-model="tel" /> <br>
        备注：<input type="text" v-model="tips" /> <br>
        是否是默认地址：
        <label><input type="radio" v-model="ad" value="1" /> 是</label>
        <label><input type="radio" v-model="ad" value="0" /> 否</label><br>
        <button @click="add">点击添加地址</button>
    </div>
</template>

<script setup>
import {ref} from 'vue';
import axios from 'axios';
let name = ref('');
let area = ref('');
let address = ref('');
let tel = ref('');
let tips = ref('');
let ad = ref('');

let add = ()=>{
    axios.post('/api/add',{
        name:name.value,
        area:area.value,
        address:address.value,
        tel:tel.value,
        tips:tips.value,
        ad:ad.value
    }).then(res=>{
        console.log(res.data);
    });
};
</script>

<style lang="scss" scoped>


</style>